<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .lis{
            width: 300px;
            margin: 50px;
            float: left;
        }
    </style>
</head>
<body>
    <script src="https://unpkg.com/vue@3.2.47/dist/vue.global.js"></script>
    <!-- 在原有作业基础上,使用list遍历商品,每个商品初始为100个商品数量，给个input输入，输入1 对应的商品数据要 -1，如果剩余数量为0，不展示 -->
    <div id="main">
        <div class="lis">
            <img width="300" height="260" :src="list[0].image" alt=""scrset="">
               <div>{{list[0].name}}</div>
        </div>
        <div class="lis">
            <img width="300" height="260" :src="list[1].image" alt=""scrset="">
               <div>{{list[1].name}}</div>
        </div>
        <div class="lis">
            <img width="300" height="260" :src="list[2].image" alt=""scrset="">
               <div>{{list[2].name}}</div>
        </div>

    </div>


    <script>
        Vue.createApp({
            data(){
                return{
                    list:[
                        {id:0,data:100,price:8,name:"可乐",image:"https://img0.baidu.com/it/u=3586008170,3691985585&fm=253&fmt=auto&app=120&f=JPEG?w=750&h=500"},
                        {id:1,data:100,price:800,name:"金毛",image:"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F201508%2F26%2F20150826194244_K53Be.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1683687165&t=2bdebbcae6d107f308439841308b02df"},
                        {id:3,data:100,price:5000000,name:"法拉利",image:"https://img2.baidu.com/it/u=3872069437,2257791818&fm=253&fmt=auto&app=138&f=JPEG?w=762&h=500"}
                    ]
                }
            }
        }).mount("#main")
    </script>
</body>
</html>